<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    //转化成Number类型:praseInt()、praseFloat()、Number()
    var a = '123.456img';
    var a1 = parseInt(a);
    var a2 = parseFloat(a);
    document.write("a1=" + a1 + '<br/>' + "a2=" + a2 + '<br/>');
    document.write(typeof a2+'<br/>');

    //转化成String类型:+""、String()
    var b = 3.1415926;
    var b1 = b + "";
    document.write(typeof(b1) +'<br/>');

    //转化成Boolean类型:!!、Boolean()
    
</script>
</html>